<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
			<form:form name="form_da" commandName="da">
			<table class="inner">
				<tr>
					<th>ID:</th>
					<td colspan="4"><c:out value="${da.dialogueActId}" /></td>
				</tr>
				<tr>
					<th>User:</th>
					<td colspan="4"><c:out value="${da.user.userName}" /></td>
				</tr>
				<tr>
					<th>Created:</th>
					<td><c:out value="${da.createdAt}" /></td>
				</tr>
				<tr>
					<th>Last saved:</th>
					<td><c:out value="${da.lastSavedAt}" /></td>
				</tr>
				<tr>
					<th>Text Segment</th>
					<td>
					Start with:
						</td>						
						<td>
					<form:select path="startIndex">
						<form:option value="null" label="Please Select" />
						<form:options items="${message.wordList}" itemValue="index"
							itemLabel="word" />
					</form:select>
						</td>
						<td>
					End with:
						</td>						
						<td>
					<form:select path="endIndex">
						<form:option value="null" label="Please Select" />
						<form:options items="${message.wordList}" itemValue="index"
							itemLabel="word" />
					</form:select>
					</td>
				</tr>
				<tr>
					<th>Dialogue Act</th>
					<td>
						Function:  
						</td>						
						<td>
         <form:select path="function" onchange="functionChanged();">
            <option value="null">Please select</option>
            <c:forEach items="${da_functions}" var="daLabel">
              <option value='<c:out value="${daLabel.dialogueActLabelId}"/>'
                <c:if test="${da.function.dialogueActLabelId == daLabel.dialogueActLabelId}">selected</c:if>>
                <c:out value="${daLabel.label}" />
              </option>
            </c:forEach>
          </form:select>
						</td>
						<td>
					  Domain:
						</td>						
						<td>
         <form:select path="domain" onchange="domainChanged();">
            <option value="null">Please select</option>
            <c:forEach items="${da_domains}" var="daLabel">
              <option value='<c:out value="${daLabel.dialogueActLabelId}"/>'
                <c:if test="${da.domain.dialogueActLabelId == daLabel.dialogueActLabelId}">selected</c:if>>
                <c:out value="${daLabel.label}" />
              </option>
            </c:forEach>
          </form:select>
					</td>
				</tr>
				<tr>
					<th rowspan="2">Adjacency</th>
					<td>
						Relationship:					  
						</td>						
						<td colspan="3">
						  <form:select path="adjacency">
                <option value="null">Please select</option>
                <c:forEach items="${adjacencies}" var="adj">       
                  <option value='<c:out value="${adj.adjacencyId}"/>'
                    <c:if test="${da.adjacency.adjacencyId == adj.adjacencyId}">selected</c:if>>
                    <c:out value="${adj.label}" />
                  </option>
                </c:forEach>
              </form:select>
			    </td>
			  </tr>
			  <tr>
			    <td>
				    To:
				  </td>						
				  <td colspan="3">
						<form:select path="adjacentDialogueAct">
              	<option value="null">Please select</option>
                <c:forEach items="${message.conversation.sortedDialogueActs}" var="sda">
                	<c:if test="${sda.user.userId == anno_user.userId}">
                  <option value='<c:out value="${sda.dialogueActId}"/>'
                    <c:if test="${da.adjacentDialogueAct.dialogueActId == sda.dialogueActId}">selected</c:if>>
                    <c:out value="${sda.textForSelectOption}" />
                  </option>
                  </c:if>
                </c:forEach>
              </form:select>
				</tr>
			</table>
			<p align="center">
				<input type="submit" value="Save" />
				<input type="button" value="Cancel" onClick="javascript: history.go(-1)" />
			</p>
			</form:form>
		